package com.v2.k46;


import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 测试@Autowired1
 * 用ClassPathXmlApplicationContext测试@Autowired
 * @Autowired 与xml方式相比将byType和byName结合起来了
 */
public class Test {

	public static void main(String[] args) {

		ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-k46.xml");

		Student1 s = (Student1)applicationContext.getBean("student1");
		System.out.println(s);
		System.out.println(s.p1);

	}


}
